package com.kitty.game.fight.pet;

import com.kitty.game.fight.bean.Fight;
import com.kitty.game.fight.bean.FightObject;
import com.kitty.game.fight.SkillConst;
//后加
import com.kitty.game.fight.pet.FaLiHuDunProcessor;
import com.kitty.game.fight.pet.QianKunZhaoProcessor;
import com.kitty.game.fight.pet.RuYiQuanProcessor;
import com.kitty.game.fight.pet.SheMingYiJiProcessor;
import com.kitty.game.fight.pet.SheShenQuYiProcessor;
import com.kitty.game.fight.pet.SheShengZhiGuangProcessor;
import com.kitty.game.fight.pet.ShenLongZhaoProcessor;
import com.kitty.game.fight.pet.WuSeGuangHuanProcessor;
import com.kitty.game.fight.pet.YiHuaJieMuProcessor;
import com.kitty.game.fight.pet.YouShuoZhiSheProcessor;

import java.util.HashMap;
import java.util.Map;

/**
 * 宠物技能处理器
 */
public abstract class PetSkillProcessor {

    /**
     * 技能id-->效果处理器
     */
    static Map<Integer, PetSkillProcessor> processorMap = new HashMap<>();

    static {
        processorMap.put(SkillConst.SKILL_QIAN_KUN, new QianKunZhaoProcessor());
        processorMap.put(SkillConst.SKILL_SHEN_LONG, new ShenLongZhaoProcessor());
        processorMap.put(SkillConst.SKILL_SHE_MING, new SheMingYiJiProcessor());
        processorMap.put(SkillConst.SKILL_SHE_SHEN, new SheShenQuYiProcessor());
        processorMap.put(SkillConst.SKILL_RU_YI, new RuYiQuanProcessor());
        processorMap.put(SkillConst.SKILL_SHEN_SHENG, new SheShengZhiGuangProcessor());
        processorMap.put(SkillConst.SKILL_YOU_SHUO, new YouShuoZhiSheProcessor());
        processorMap.put(SkillConst.SKILL_WU_SE, new WuSeGuangHuanProcessor());
        processorMap.put(SkillConst.SKILL_FA_LI, new FaLiHuDunProcessor());
        processorMap.put(SkillConst.SKILL_YI_HUA, new YiHuaJieMuProcessor());
    }

    public static PetSkillProcessor queryProcessor(int skillId) {
        return processorMap.get(skillId);
    }

    /**
     * 技能触发
     * @param fight
     * @param effector
     * @param target
     * @param args
     */
    public abstract void trigger(Fight fight, FightObject effector, FightObject target, int skillLevel, Object... args) ;

    /**
     * 效果执行
     * @param fight
     * @param effector
     * @param target
     * @param args
     */
    public abstract Object effect(Fight fight, FightObject effector, FightObject target, Object... args);

    /**
     * 关联的状态
     * @return
     */
    public int bindingStatus() {
        return 0;
    }
}
